import _ from 'lodash';

const dataMaker = (data, fix = 0) => _.map(data, (label, i) => ({
  value: i + 1 + fix,
  label,
}));

const arrTurnObj = (data, fix = 0) => {
  const res = {};
  _.forEach(data, (d, i) => {
    res[i + 1 + fix] = d;
  })
  return res
}


const tastTypeData = ['生日提醒', '保单过期提醒', '拜访客户'];
export const taskType = dataMaker(tastTypeData);
export const _taskType = arrTurnObj(tastTypeData);

const genderData = ['男', '女'];
export const gender = dataMaker(genderData);
export const _gender = arrTurnObj(genderData);

const relationData = [
  '丈夫', '妻子', '父亲', '母亲', '儿子', '女儿', '公公', '婆婆', '岳父', '岳母'
];
export const relationType = dataMaker(relationData, 1);
export const _relationType = arrTurnObj(relationData, 1);

export const rt1 = [2, 8, 9]; // 男
export const rt2 = [3, 10, 11]; // 女

const educationTypeData = [
  '初中以下', '中职/高中', '专科', '本科', '硕士及以上'
];
export const educationType = dataMaker(educationTypeData);
export const _educationType = arrTurnObj(educationTypeData);

const jobTypeData = [
  '农民', '个体户', '在校学生', '企业员工', '企业管理人员', '机关和事业单位人员', '自由职业者', '退休或者待业'
];
export const jobType = dataMaker(jobTypeData);
export const _jobType = arrTurnObj(jobTypeData);
